import type { Metadata } from "next"; import { notFound } from "next/navigation"; import { apiServer } from "@/lib/api-server"; import type { GameInfo } from "@spinza/shared"; import type { ClientDefinition } from "@/components/game/types"; import { GameClient } from "@/components/game/game-client"; type Params = { params: Promise<{ slug: string }> }; export async function generateMetadata({ params }: Params): Promise { const { slug } = await params; const data = await apiServer<{ game: GameInfo }>(`/api/games/${slug}`); if (!data) return { title: "Game not found" }; return { title: `${data.game.name} — play free`, description: data.game.description, robots: { index: false } }; } export default async function GamePage({ params }: Params) { const { slug } = await params; const data = await apiServer<{ game: GameInfo; definition: ClientDefinition }>(`/api/games/${slug}`); if (!data) notFound(); return ; }